﻿#region RDIFramework.NET-generated
//------------------------------------------------------------------------------
//	RDIFramework.NET（.NET快速信息化系统开发、整合框架）是基于.NET的快速信息化系统开发、整合框架，给用户和开发者最佳的.Net框架部署方案。
//	RDIFramework.NET平台包含基础公共类库、强大的权限控制、模块分配、数据字典、自动升级、各商业级控件库、工作流平台、代码生成器、开发辅助
//工具等，应用系统的各个业务功能子系统，在系统体系结构设计的过程中被设计成各个原子功能模块，各个子功能模块按照业务功能组织成单独的程序集文
//件，各子系统开发完成后，由RDIFramework.NET平台进行统一的集成部署。
//
// 官方博客：http://www.cnblogs.com/huyong
//           http://blog.csdn.net/chinahuyong
//    Email：80368704@qq.com
//       QQ：80368704
//------------------------------------------------------------------------------
// <auto-generated>
//	此代码由RDIFramework.NET平台代码生成工具自动生成。
//	运行时版本:4.0.30319.1
//
//	对此文件的更改可能会导致不正确的行为，并且如果
//	重新生成代码，这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
#endregion

using System;
using System.Collections.Generic;
using System.Data;

namespace Centaline.BizLogic
{
    using RDIFramework.Utilities;

    /// <summary>
    /// ArticleEntity
    /// 
    /// 
    /// 修改纪录
    /// 
    /// 2014-04-09 版本：1.0  创建主键。
    /// 
    /// 版本：1.0
    /// 
    /// <author>
    /// <name></name>
    /// <date>2014-04-09</date>
    /// </author>
    /// </summary>
    [Serializable]
    public partial class ArticleEntity 
    {
        private int? id = null;
        /// <summary>
        /// Id
        /// </summary>
        public int? Id
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        private int? fixerId = null;
        /// <summary>
        /// FixerId
        /// </summary>
        public int? FixerId
        {
            get
            {
                return this.fixerId;
            }
            set
            {
                this.fixerId = value;
            }
        }

        private String troubleDes = string.Empty;
        /// <summary>
        /// 问题描述
        /// </summary>
        public String TroubleDes
        {
            get
            {
                return this.troubleDes;
            }
            set
            {
                this.troubleDes = value;
            }
        }

        private int? deleteMark = null;
        /// <summary>
        /// DeleteMark
        /// </summary>
        public int? DeleteMark
        {
            get
            {
                return this.deleteMark;
            }
            set
            {
                this.deleteMark = value;
            }
        }

        private int? sortCode = null;
        /// <summary>
        /// SortCode
        /// </summary>
        public int? SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public ArticleEntity()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">数据行</param>
        public ArticleEntity(DataRow dataRow)
        {
            this.GetFrom(dataRow);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataReader">数据流</param>
        public ArticleEntity(IDataReader dataReader)
        {
            this.GetFrom(dataReader);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public ArticleEntity(DataTable dataTable)
        {
            this.GetSingle(dataTable);
        }

        /// <summary>
        /// 从数据表读取
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public ArticleEntity GetSingle(DataTable dataTable)
        {
            if ((dataTable == null) || (dataTable.Rows.Count == 0))
            {
                return null;
            }
            foreach (DataRow dataRow in dataTable.Rows)
            {
                this.GetFrom(dataRow);
                break;
            }
            return this;
        }

        /// <summary>
        /// 从数据表读取返回实体列表
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public List<ArticleEntity>  GetList(DataTable dataTable)
        {
            List<ArticleEntity> entities=new List<ArticleEntity>();
            foreach(DataRow dataRow in dataTable.Rows)
            {
                entities.Add(GetFrom(dataRow));
            }
            return entities;
        }

        /// <summary>
        /// 从数据行读取
        /// </summary>
        /// <param name="dataRow">数据行</param>
        public ArticleEntity GetFrom(DataRow dataRow)
        {
            this.Id = BusinessLogic.ConvertToInt32(dataRow[ArticleTable.FieldId]);
            this.FixerId = BusinessLogic.ConvertToInt32(dataRow[ArticleTable.FieldFixerId]);
            this.TroubleDes = BusinessLogic.ConvertToString(dataRow[ArticleTable.FieldTroubleDes]);
            this.DeleteMark = BusinessLogic.ConvertToInt32(dataRow[ArticleTable.FieldDeleteMark]);
            this.SortCode = BusinessLogic.ConvertToInt32(dataRow[ArticleTable.FieldSortCode]);
            return this;
        }

        /// <summary>
        /// 从数据流读取
        /// </summary>
        /// <param name="dataReader">数据流</param>
        public ArticleEntity GetFrom(IDataReader dataReader)
        {
            this.Id = BusinessLogic.ConvertToInt32(dataReader[ArticleTable.FieldId]);
            this.FixerId = BusinessLogic.ConvertToInt32(dataReader[ArticleTable.FieldFixerId]);
            this.TroubleDes = BusinessLogic.ConvertToString(dataReader[ArticleTable.FieldTroubleDes]);
            this.DeleteMark = BusinessLogic.ConvertToInt32(dataReader[ArticleTable.FieldDeleteMark]);
            this.SortCode = BusinessLogic.ConvertToInt32(dataReader[ArticleTable.FieldSortCode]);
            return this;
        }
    }
}
